# Contributor: Grigory Kirillov <txgk@bk.ru>
# Maintainer:
pkgname=libqd
pkgver=2.3.23
pkgrel=2
pkgdesc="Double-double and quad-double library for Fortran and C++"
url="https://www.davidhbailey.com/dhbsoftware"
# aarch64, ppc64le, s390x: fail tests
arch="all !aarch64 !ppc64le !s390x"
license="BSD-3-Clause-LBNL"
makedepends="gfortran"
source="https://archive.org/download/qd-$pkgver.tar.gz/qd-$pkgver.tar.gz"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
builddir="$srcdir/qd-$pkgver"

build() {
	export CXXFLAGS="${CXXFLAGS/-Os/-O3}" # gotta go fast

	./configure \
		--target="$CTARGET" \
		--build="$CBUILD" \
		--host="$CHOST" \
		--prefix=/usr
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
ab311883db7708cee1c307eead5d02dac3b9809389b8d29e2fda5207decb752ca360a9aab234dd8a70228e0e004a6b6d6cdf92fd098536e96a2fa01c5b2ced2c  qd-2.3.23.tar.gz
"
